package com.wtwd.device.service;


import com.wtwd.device.model.entity.FriendRequests;
import com.wtwd.device.model.vo.RespEntity;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.PageRequest;

import java.util.List;


/**
 * @author mjy
 * @since 2021-09-16 10:37:24
 */
public interface FriendRequestsService {

    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    FriendRequests queryById(Long id);

    /**
     * 分页查询
     *
     * @param friendRequests 筛选条件
     * @param pageRequest    分页对象
     * @return 查询结果
     */
    Page<FriendRequests> queryByPage(FriendRequests friendRequests, PageRequest pageRequest);

    /**
     * 新增数据
     *
     * @param friendRequests 实例对象
     * @return Integer
     */
    Integer insert(FriendRequests friendRequests);

    /**
     * 修改数据
     *
     * @param friendRequests 实例对象
     * @return 实例对象
     */
    FriendRequests update(FriendRequests friendRequests);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     * @return 是否成功
     */
    boolean deleteById(Long id);

    Integer updateFriendRequestStatus(Integer type, Long id,Long recoveryTime);

    RespEntity getFriendRequestsList(Integer currentPage, Integer pageSize, Long userId);

    List<FriendRequests> getFriendRequestByConditions(FriendRequests selectFriend);

    RespEntity getUserRequestsList(Integer currentPage, Integer pageSize, Long userId);

    FriendRequests getApplyFriendRequestByProposerAndRespondent(Long proposer, Long respondent);

    RespEntity getFriendAllApplyById(String userId, Integer pageSize, Integer currentPage);
}
